import 'package:flutter/material.dart';

class StepperTest extends StatefulWidget {
  @override
  _StepperTestState createState() => _StepperTestState();
}

class _StepperTestState extends State<StepperTest> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        title: Text('流程指示Stepper'),
        centerTitle: true,
      ),
      // body: new ListView(
      //   children: <Widget>[
      //     new ListTile(
      //       title: new Stepper(
      //         type: StepperType.vertical,
      //         // type: StepperType.horizontal,
      //         steps: <Step>[
      //           _buildStep("初审",true),
      //           _buildStep("补材料",true),
      //           _buildStep("审批中",false),
      //           _buildStep("已放款",false),
      //         ],
      //       ),
      //     ),
      //   ],
      // ),

      body: new Container(
        child: new Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            new Stepper(
              //type: StepperType.vertical,
              // type: StepperType.horizontal,
              steps: <Step>[
                _buildStep("初审",true),
                _buildStep("补材料",true),
                _buildStep("审批中",false),
                _buildStep("已放款",false),
              ],
            ),
          ],
        ),
      ),
    );
  }

  Step _buildStep(String title, bool active) {
    return new Step(title: new Text(title), content: _buildStepContent(title), isActive: active,);
  }

  Widget _buildStepContent(String title) {
    // return new Center(
    //     child: new Column(
    //       mainAxisAlignment: MainAxisAlignment.center,
    //       children: <Widget>[
    //         new Text("[$title]开发中，敬请期待..."),
    //       ],
    //     ),
    //   );
    return new Text("[$title]开发中，敬请期待...");
  }
}